//
//  HoldbackAlertView.h
//  gamebox_qpp
//
//  Created by 赵隆杰 on 2022/2/10.
//

#import "HoldbackAlertView.h"

@interface HoldbackAlertView()

@end

@implementation HoldbackAlertView

-(void)awakeFromNib
{
    [super awakeFromNib];
    
    
}


- (IBAction)close:(UIButton *)sender {
    [self removeFromSuperview];
}

- (IBAction)sure:(UIButton *)sender {
    NSInteger tag = sender.tag;
    if (self.sure) {
        self.sure(tag);
    }
    
    [self removeFromSuperview];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{

    CGPoint point = [[touches anyObject] locationInView:self];
    UIView* chatView = [self viewWithTag:100];
    point = [chatView.layer convertPoint:point fromLayer:self.layer];
    if(![chatView.layer containsPoint:point]){
        [self removeFromSuperview];
    }

}

@end
